﻿
//根据日期获取年份
function Year(){
	this.isCal = false;
}

Year.prototype = {
	calculate:function(expression){
		if(CalculateUtil.isNull(expression)){
			expression = CalculateUtil.getCurrentDate();
		}
		if(expression.length<4){
			throw new Error("Year.calculate():时间格式不对");
		}
		expression = expression.substr(0,4);
		if(!CalculateUtil.isNumber(expression)){
			throw new Error("Year.calculate():时间的组成不是数字");
		}
		return expression;
	}
}